package demo4;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        MyBlockingQueue myQueue=new MyBlockingQueue(5);
        myQueue.put(12);
        myQueue.put(23);
        myQueue.put(34);
        myQueue.put(45);
        myQueue.put(56);
        System.out.println("已经插入5个了");
//        myQueue.put(78);
//        System.out.println("已经插入6个了");
        myQueue.take();
        myQueue.take();
        myQueue.take();
        myQueue.take();
        myQueue.take();
        System.out.println("已经取出5个了");
        myQueue.take();
        System.out.println("已经取出6个了");
    }
}
